// ****************************************************************************** 
// Copyright     :  Copyright (C) 2018, Hisilicon Technologies Co. Ltd.
// File name     :  prc_c_union_define.h
// Project line  :  K3
// Department    :  K3
// Author        :  Huawei
// Version       :  V100
// Date          :  2015/4/10
// Description   :  HiVcodecV100 VDEC
// Others        :  Generated automatically by nManager V4.2 
// History       :  Huawei 2018/04/10 10:02:40 Create file
// ******************************************************************************

#ifndef __PRC_C_UNION_DEFINE_H__
#define __PRC_C_UNION_DEFINE_H__

/* Define the union U_MB_INF */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_0   : 7  ; /* [31:25] */
        unsigned int    prc_mby : 9  ; /* [24:16] */
        unsigned int    rsv_1   : 7  ; /* [15:9] */
        unsigned int    prc_mbx : 9  ; /* [8:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_MB_INF;

/* Define the union U_CACHE0_TOTAL_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch0_total_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE0_TOTAL_CNT;

/* Define the union U_CACHE0_HIT_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch0_hit_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE0_HIT_CNT;

/* Define the union U_CACHE0_REQHIT_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch0_reqhit_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE0_REQHIT_CNT;

/* Define the union U_CACHE0_MISS_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch0_miss_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE0_MISS_CNT;

/* Define the union U_CACHE0_FE_WORK_TIME */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch0_fe_work_time : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE0_FE_WORK_TIME;

/* Define the union U_CACHE1_TOTAL_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch1_total_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE1_TOTAL_CNT;

/* Define the union U_CACHE1_HIT_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch1_hit_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE1_HIT_CNT;

/* Define the union U_CACHE1_REQHIT_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch1_reqhit_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE1_REQHIT_CNT;

/* Define the union U_CACHE1_MISS_CNT */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch1_miss_cnt : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE1_MISS_CNT;

/* Define the union U_CACHE1_FE_WORK_TIME */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fetch1_fe_work_time : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_CACHE1_FE_WORK_TIME;

/* Define the union U_PRC_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_2          : 21  ; /* [31:11] */
        unsigned int    cmd_state      : 3  ; /* [10:8] */
        unsigned int    rsv_3          : 1  ; /* [7] */
        unsigned int    fetch0_fistate : 3  ; /* [6:4] */
        unsigned int    rsv_4          : 1  ; /* [3] */
        unsigned int    fetch0_festate : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_STATE;

/* Define the union U_PRC_BUF_STATE0 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_5                 : 28  ; /* [31:4] */
        unsigned int    fetcho_fbuffull       : 1  ; /* [3] */
        unsigned int    fetcho_festall        : 1  ; /* [2] */
        unsigned int    fetch0_fereqfull      : 1  ; /* [1] */
        unsigned int    fetch0_fbuf_valid_fag : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_BUF_STATE0;

/* Define the union U_PRC_BUF_8BIT_STATE1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fe_inf1_8bit_cnt  : 8  ; /* [31:24] */
        unsigned int    fe_inf0_8bit_cnt  : 8  ; /* [23:16] */
        unsigned int    rsv_6             : 1  ; /* [15] */
        unsigned int    fmt_inf1_8bit_cnt : 7  ; /* [14:8] */
        unsigned int    rsv_7             : 1  ; /* [7] */
        unsigned int    fmt_inf0_8bit_cnt : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_BUF_8BIT_STATE1;

/* Define the union U_OUT_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_8            : 14  ; /* [31:18] */
        unsigned int    cur_st_2bit_rdf  : 2  ; /* [17:16] */
        unsigned int    rsv_9            : 5  ; /* [15:11] */
        unsigned int    cur_st_2bit_fmt  : 3  ; /* [10:8] */
        unsigned int    rsv_10           : 3  ; /* [7:5] */
        unsigned int    out_str_2bit_ful : 1  ; /* [4] */
        unsigned int    rsv_11           : 3  ; /* [3:1] */
        unsigned int    out_str_ful      : 1  ; /* [0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_OUT_STATE;

/* Define the union U_FMT_STATE */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    rsv_12     : 21  ; /* [31:11] */
        unsigned int    cur_st_rdf : 3  ; /* [10:8] */
        unsigned int    rsv_13     : 1  ; /* [7] */
        unsigned int    cur_st_pod : 3  ; /* [6:4] */
        unsigned int    rsv_14     : 1  ; /* [3] */
        unsigned int    cur_st_fmt : 3  ; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_FMT_STATE;

/* Define the union U_PRC_BUF_2BIT_STATE1 */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    fe_inf1_2bit_cnt  : 8  ; /* [31:24] */
        unsigned int    fe_inf0_2bit_cnt  : 8  ; /* [23:16] */
        unsigned int    rsv_15            : 1  ; /* [15] */
        unsigned int    fmt_inf1_2bit_cnt : 7  ; /* [14:8] */
        unsigned int    rsv_16            : 1  ; /* [7] */
        unsigned int    fmt_inf0_2bit_cnt : 7  ; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_BUF_2BIT_STATE1;

/* Define the union U_PRC_TOTAL_ABS_MVX_L */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    total_abs_mvx[31:0] : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_TOTAL_ABS_MVX_L;

/* Define the union U_PRC_TOTAL_ABS_MVX_H */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    total_abs_mvx[63:32] : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_TOTAL_ABS_MVX_H;

/* Define the union U_PRC_TOTAL_ABS_MVY_L */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    total_abs_mvy[31:0 : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_TOTAL_ABS_MVY_L;

/* Define the union U_PRC_TOTAL_ABS_MVY_H */
typedef union
{
    /* Define the struct bits */
    struct
    {
        unsigned int    total_abs_mvy[63:32] : 32  ; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    unsigned int    u32;

} U_PRC_TOTAL_ABS_MVY_H;


//==============================================================================
/* Define the global struct */
typedef struct
{
    volatile U_MB_INF              MB_INF              ; /* 0 */
    volatile U_CACHE0_TOTAL_CNT    CACHE0_TOTAL_CNT    ; /* 4 */
    volatile U_CACHE0_HIT_CNT      CACHE0_HIT_CNT      ; /* 8 */
    volatile U_CACHE0_REQHIT_CNT   CACHE0_REQHIT_CNT   ; /* C */
    volatile U_CACHE0_MISS_CNT     CACHE0_MISS_CNT     ; /* 10 */
    volatile U_CACHE0_FE_WORK_TIME CACHE0_FE_WORK_TIME ; /* 14 */
    volatile U_CACHE1_TOTAL_CNT    CACHE1_TOTAL_CNT    ; /* 18 */
    volatile U_CACHE1_HIT_CNT      CACHE1_HIT_CNT      ; /* 1C */
    volatile U_CACHE1_REQHIT_CNT   CACHE1_REQHIT_CNT   ; /* 20 */
    volatile U_CACHE1_MISS_CNT     CACHE1_MISS_CNT     ; /* 24 */
    volatile U_CACHE1_FE_WORK_TIME CACHE1_FE_WORK_TIME ; /* 28 */
    volatile U_PRC_STATE           PRC_STATE           ; /* 2C */
    volatile U_PRC_BUF_STATE0      PRC_BUF_STATE0      ; /* 30 */
    volatile U_PRC_BUF_8BIT_STATE1 PRC_BUF_8BIT_STATE1 ; /* 34 */
    volatile U_OUT_STATE           OUT_STATE           ; /* 38 */
    volatile U_FMT_STATE           FMT_STATE           ; /* 3C */
    volatile U_PRC_BUF_2BIT_STATE1 PRC_BUF_2BIT_STATE1 ; /* 40 */
    volatile U_PRC_TOTAL_ABS_MVX_L PRC_TOTAL_ABS_MVX_L ; /* 44 */
    volatile U_PRC_TOTAL_ABS_MVX_H PRC_TOTAL_ABS_MVX_H ; /* 48 */
    volatile U_PRC_TOTAL_ABS_MVY_L PRC_TOTAL_ABS_MVY_L ; /* 4C */
    volatile U_PRC_TOTAL_ABS_MVY_H PRC_TOTAL_ABS_MVY_H ; /* 50 */

} S_prc_REGS_TYPE;

/* Declare the struct pointor of the module prc */
extern volatile S_prc_REGS_TYPE *gopprcAllReg;

/* Declare the functions that set the member value */
int iSetMB_INF_prc_mby(unsigned int uprc_mby);
int iSetMB_INF_prc_mbx(unsigned int uprc_mbx);
int iSetCACHE0_TOTAL_CNT_fetch0_total_cnt(unsigned int ufetch0_total_cnt);
int iSetCACHE0_HIT_CNT_fetch0_hit_cnt(unsigned int ufetch0_hit_cnt);
int iSetCACHE0_REQHIT_CNT_fetch0_reqhit_cnt(unsigned int ufetch0_reqhit_cnt);
int iSetCACHE0_MISS_CNT_fetch0_miss_cnt(unsigned int ufetch0_miss_cnt);
int iSetCACHE0_FE_WORK_TIME_fetch0_fe_work_time(unsigned int ufetch0_fe_work_time);
int iSetCACHE1_TOTAL_CNT_fetch1_total_cnt(unsigned int ufetch1_total_cnt);
int iSetCACHE1_HIT_CNT_fetch1_hit_cnt(unsigned int ufetch1_hit_cnt);
int iSetCACHE1_REQHIT_CNT_fetch1_reqhit_cnt(unsigned int ufetch1_reqhit_cnt);
int iSetCACHE1_MISS_CNT_fetch1_miss_cnt(unsigned int ufetch1_miss_cnt);
int iSetCACHE1_FE_WORK_TIME_fetch1_fe_work_time(unsigned int ufetch1_fe_work_time);
int iSetPRC_STATE_cmd_state(unsigned int ucmd_state);
int iSetPRC_STATE_fetch0_fistate(unsigned int ufetch0_fistate);
int iSetPRC_STATE_fetch0_festate(unsigned int ufetch0_festate);
int iSetPRC_BUF_STATE0_fetcho_fbuffull(unsigned int ufetcho_fbuffull);
int iSetPRC_BUF_STATE0_fetcho_festall(unsigned int ufetcho_festall);
int iSetPRC_BUF_STATE0_fetch0_fereqfull(unsigned int ufetch0_fereqfull);
int iSetPRC_BUF_STATE0_fetch0_fbuf_valid_fag(unsigned int ufetch0_fbuf_valid_fag);
int iSetPRC_BUF_8BIT_STATE1_fe_inf1_8bit_cnt(unsigned int ufe_inf1_8bit_cnt);
int iSetPRC_BUF_8BIT_STATE1_fe_inf0_8bit_cnt(unsigned int ufe_inf0_8bit_cnt);
int iSetPRC_BUF_8BIT_STATE1_fmt_inf1_8bit_cnt(unsigned int ufmt_inf1_8bit_cnt);
int iSetPRC_BUF_8BIT_STATE1_fmt_inf0_8bit_cnt(unsigned int ufmt_inf0_8bit_cnt);
int iSetOUT_STATE_cur_st_2bit_rdf(unsigned int ucur_st_2bit_rdf);
int iSetOUT_STATE_cur_st_2bit_fmt(unsigned int ucur_st_2bit_fmt);
int iSetOUT_STATE_out_str_2bit_ful(unsigned int uout_str_2bit_ful);
int iSetOUT_STATE_out_str_ful(unsigned int uout_str_ful);
int iSetFMT_STATE_cur_st_rdf(unsigned int ucur_st_rdf);
int iSetFMT_STATE_cur_st_pod(unsigned int ucur_st_pod);
int iSetFMT_STATE_cur_st_fmt(unsigned int ucur_st_fmt);
int iSetPRC_BUF_2BIT_STATE1_fe_inf1_2bit_cnt(unsigned int ufe_inf1_2bit_cnt);
int iSetPRC_BUF_2BIT_STATE1_fe_inf0_2bit_cnt(unsigned int ufe_inf0_2bit_cnt);
int iSetPRC_BUF_2BIT_STATE1_fmt_inf1_2bit_cnt(unsigned int ufmt_inf1_2bit_cnt);
int iSetPRC_BUF_2BIT_STATE1_fmt_inf0_2bit_cnt(unsigned int ufmt_inf0_2bit_cnt);
int iSetPRC_TOTAL_ABS_MVX_L_total_abs_mvx[31:0](unsigned int utotal_abs_mvx[31:0]);
int iSetPRC_TOTAL_ABS_MVX_H_total_abs_mvx[63:32](unsigned int utotal_abs_mvx[63:32]);
int iSetPRC_TOTAL_ABS_MVY_L_total_abs_mvy[31:0(unsigned int utotal_abs_mvy[31:0);
int iSetPRC_TOTAL_ABS_MVY_H_total_abs_mvy[63:32](unsigned int utotal_abs_mvy[63:32]);

#endif // __PRC_C_UNION_DEFINE_H__
